﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Lottery.Client.SL
{
    public class DataCache
    {
        private static List<WinTypeInfo> _winTypeDatas;
        public static List<WinTypeInfo> WinTypeDatas
        {
            get { return _winTypeDatas??(_winTypeDatas = new List<WinTypeInfo>()); }
            set { _winTypeDatas = value; }
        }

        public static UserScaleInfos CurrentUserScaleInfo;
        public static ObservableCollection<SimpleSchemeInfo> CurrentDealStart { get; set; }
        private static List<LotteryInfo> _lotteryDatas;
        public static List<LotteryInfo> LotteryDatas
        {
            get
            {
                if(_lotteryDatas == null)
                {
                    _lotteryDatas = new List<LotteryInfo>();
                    _lotteryDatas.Add(new LotteryInfo(){ID = 4,Name = "数字排列",OpenChase = false});
                    _lotteryDatas.Add(new LotteryInfo() { ID = 6, Name = "福彩3D", OpenChase = false });
                    _lotteryDatas.Add(new LotteryInfo() { ID = 2, Name = "天津时时彩", OpenChase = false });
                    _lotteryDatas.Add(new LotteryInfo() { ID = 3, Name = "重庆时时彩", OpenChase = false });
                    _lotteryDatas.Add(new LotteryInfo() { ID = 29, Name = "上海时时乐", OpenChase = false });
                    _lotteryDatas.Add(new LotteryInfo() { ID = 5, Name = "新疆时时彩", OpenChase = false });
                    _lotteryDatas.Add(new LotteryInfo() { ID = 6, Name = "江西时时彩", OpenChase = false });
                }
                return _lotteryDatas;
            }
            set { _lotteryDatas = value; }
        }

        private static CurrentPlayData _currentPlayInfo;
        public static CurrentPlayData CurrentPlayInfo
        {
            get { return _currentPlayInfo??(_currentPlayInfo = new CurrentPlayData()); }
            set { _currentPlayInfo = value; }
        }

        public static UserInfo CurrentUserInfo
        {
            get;
            set;
        }

        private static NowSchemeCache _currentSchemeCache;

        public static NowSchemeCache CurrentSchemeCache
        {
            get { return _currentSchemeCache??(_currentSchemeCache= new NowSchemeCache()); }
            set { _currentSchemeCache = value; }
        }

        public static string Units { get; set; }
        private static List<NewsData> _newsDatas;
        public static List<NewsData> NewsDatas { get
        {
            if (_newsDatas == null)
            {
                var t = new List<NewsData>();
                t.Add(new NewsData()
                          {
                              ID = 1,
                              AffichesCount = "版权说明...",
                              AffichesTime = DateTime.Now.ToShortDateString(),
                              AffichesTitle = "[版权说明]"
                          });
                t.Add(new NewsData()
                          {
                              ID = 2,
                              AffichesCount = "充值说明...",
                              AffichesTime = DateTime.Now.ToShortDateString(),
                              AffichesTitle = "[充值说明]"
                          });
                t.Add(new NewsData()
                          {
                              ID = 3,
                              AffichesCount = "游戏细则...",
                              AffichesTime = DateTime.Now.ToShortDateString(),
                              AffichesTitle = "[游戏细则]"
                          });
                t.Add(new NewsData()
                          {
                              ID = 4,
                              AffichesCount = "玩法说明...",
                              AffichesTime = DateTime.Now.ToShortDateString(),
                              AffichesTitle = "[玩法说明]"
                          });
                t.Add(new NewsData()
                          {
                              ID = 4,
                              AffichesCount = "责任声明...",
                              AffichesTime = DateTime.Now.ToShortDateString(),
                              AffichesTitle = "[责任声明]"
                          });
                t.Add(new NewsData()
                          {
                              ID = 4,
                              AffichesCount = "平台简介...",
                              AffichesTime = DateTime.Now.ToShortDateString(),
                              AffichesTitle = "[平台简介]"
                          });
                _newsDatas = t;
            }
            return _newsDatas;
        } set { _newsDatas = value; } }
        public static bool RealSound { get; set; }
        public static UserBankInfo CurrentUserBankInfo { get; set; }
        private static LoginInfo _currentLoginInfo;
        public static LoginInfo CurrentLoginInfo
        {
            get { return _currentLoginInfo??(_currentLoginInfo = new LoginInfo()); }
            set { _currentLoginInfo = value; }
        }

        public static object ChildWindowObject { get; set; }
        public static void Clear()
        {
            //DataCache._CurrentSchemeCache.InvestNum = 0;
            //DataCache._CurrentSchemeCache.InvestCount = "";
            //DataCache._CurrentLoginInfo = new LoginInfo();
            //DataCache._CurrentUserInfo = null;
            //DataCache._CurrentUserScaleInfo = null;
            //DataCache._CurrentUserBankInfo = null;
           // BetDataControl.ClearBetData();
           // DataCache._CurrentDealStart.Clear();
        }
    }
}
